package com.dhcc.servlet;

import com.dhcc.httpserver.Request;
import com.dhcc.httpserver.Response;
import com.dhcc.httpserver.Servlet;

public class LoginServlet extends Servlet{

	@Override
	protected void doGet(Request request,Response response) throws Exception {
		
		
	}

	@Override
	protected void doPost(Request request,Response response) throws Exception {
		
		String name = request.getParameter("uname");
		String pwd = request.getParameter("pwd");
		
		if (login(name, pwd)) {
			response.println("登录成功");
		}else{
			
			response.println("登录失败");
		}
		
		
	}
	
	public boolean login(String name,String pwd){
		
		return name.equals("zkr") && pwd.equals("123456");
	}
	

}
